﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeBehind="revenue_expenditure.aspx.cs" Inherits="Project_Udrinkwater.PagesAdmin.revenue_expenditure" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <dx:ASPxRoundPanel ID="RPN_ShowAcounting" runat="server" Width="100%" 
        HeaderText="รายรับ - รายจ่าย">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
    <div>
        
        <table style="width: 100%">
            <tr>
                <td>
                    <dx:ASPxCheckBoxList ID="chboxlist" runat="server" AutoPostBack="True" 
                        Font-Size="Small" 
                        OnSelectedIndexChanged="ASPxCheckBoxList1_SelectedIndexChanged" 
                        RepeatDirection="Horizontal" SelectedIndex="0">
                        <Items>
                            <dx:ListEditItem Selected="True" Text="แสดงแบบรายวัน" Value="0" />
                            <dx:ListEditItem Text="แสดงแบบรายเดือน" Value="1" />
                            <dx:ListEditItem Text="แสดงแบบรายปี" Value="2" />
                        </Items>
                    </dx:ASPxCheckBoxList>
                </td>
                <td align="right">
                    <table align="right">
                        <tr>
                            <td>
                                <dx:ASPxButton ID="bt_ExportExcel" runat="server" Text="พิมพ์รายงาน Excel" 
                                    OnClick="bt_ExportExcel_Click">
                                </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="bt_ExportPDF" runat="server" Text="พิมพ์รายงาน PDF" 
                                    OnClick="bt_ExportPDF_Click">
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        
    </div>
    <asp:Panel ID="PanelDay" runat="server">
        <dx:ASPxPivotGrid ID="PVG_ShowAcountDay" runat="server" 
        DataSourceID="SqlDataSource_SelectAcount" Width="100%">
        <Fields>
            <dx:PivotGridField ID="fieldID" AreaIndex="0" FieldName="ID">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldDateAccount" Area="RowArea" AreaIndex="0" 
                CellFormat-FormatString="dd MMMM yyyy" CellFormat-FormatType="DateTime" 
                FieldName="Date_Account" GroupInterval="Date" 
                UnboundFieldName="fieldDateAccount" Caption="วันที่">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldLastAccount" Area="ColumnArea" AreaIndex="0" 
                FieldName="Last_Account" GroupInterval="DateYear" 
                UnboundFieldName="fieldLastAccount" Caption="ปี">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldDetailList" Area="RowArea" AreaIndex="1" 
                FieldName="Detail_List" Caption="รายการ">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldMoneyDetail" Area="DataArea" AreaIndex="0" 
                FieldName="Money Detail" Caption="จำนวนเงิน">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldStatus" Area="ColumnArea" AreaIndex="1" 
                FieldName="Status">
            </dx:PivotGridField>
        </Fields>
<StylesPrint Cell-BackColor2="" Cell-GradientMode="Horizontal" FieldHeader-BackColor2="" FieldHeader-GradientMode="Horizontal" TotalCell-BackColor2="" TotalCell-GradientMode="Horizontal" GrandTotalCell-BackColor2="" GrandTotalCell-GradientMode="Horizontal" CustomTotalCell-BackColor2="" CustomTotalCell-GradientMode="Horizontal" FieldValue-BackColor2="" FieldValue-GradientMode="Horizontal" FieldValueTotal-BackColor2="" FieldValueTotal-GradientMode="Horizontal" FieldValueGrandTotal-BackColor2="" FieldValueGrandTotal-GradientMode="Horizontal" Lines-BackColor2="" Lines-GradientMode="Horizontal"></StylesPrint>
    </dx:ASPxPivotGrid>
    </asp:Panel>
    <asp:Panel ID="PanelMonth" runat="server">
        <dx:ASPxPivotGrid ID="PVG_Accountmonth" runat="server" 
        DataSourceID="SqlDataSource_SelectAcount" Width="100%">
        <Fields>
            <dx:PivotGridField ID="PivotGridField1" AreaIndex="0" FieldName="ID">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField2" Area="RowArea" AreaIndex="0" 
                CellFormat-FormatString="dd MMMM yyyy" CellFormat-FormatType="DateTime" 
                FieldName="Date_Account" GroupInterval="DateMonth" 
                UnboundFieldName="fieldDateAccount" Caption="เดือน">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField3" Area="ColumnArea" AreaIndex="0" 
                FieldName="Last_Account" GroupInterval="DateYear" 
                UnboundFieldName="fieldLastAccount" Caption="ปี">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField4" Area="RowArea" AreaIndex="1" 
                FieldName="Detail_List" Caption="รายการ">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField5" Area="DataArea" AreaIndex="0" 
                FieldName="Money Detail" Caption="จำนวนเงิน">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField6" Area="ColumnArea" AreaIndex="1" 
                FieldName="Status">
            </dx:PivotGridField>
        </Fields>
<StylesPrint Cell-BackColor2="" Cell-GradientMode="Horizontal" FieldHeader-BackColor2="" FieldHeader-GradientMode="Horizontal" TotalCell-BackColor2="" TotalCell-GradientMode="Horizontal" GrandTotalCell-BackColor2="" GrandTotalCell-GradientMode="Horizontal" CustomTotalCell-BackColor2="" CustomTotalCell-GradientMode="Horizontal" FieldValue-BackColor2="" FieldValue-GradientMode="Horizontal" FieldValueTotal-BackColor2="" FieldValueTotal-GradientMode="Horizontal" FieldValueGrandTotal-BackColor2="" FieldValueGrandTotal-GradientMode="Horizontal" Lines-BackColor2="" Lines-GradientMode="Horizontal"></StylesPrint>
    </dx:ASPxPivotGrid>
    </asp:Panel>
    <asp:Panel ID="PanelYear" runat="server">
        <dx:ASPxPivotGrid ID="PVG_AcountYear" runat="server" 
        DataSourceID="SqlDataSource_SelectAcount" Width="100%">
        <Fields>
            <dx:PivotGridField ID="PivotGridField7" AreaIndex="0" FieldName="ID">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField8" Area="RowArea" AreaIndex="0" 
                CellFormat-FormatString="dd MMMM yyyy" CellFormat-FormatType="DateTime" 
                FieldName="Date_Account" GroupInterval="DateYear" 
                UnboundFieldName="fieldDateAccount" Caption="ปี">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField10" Area="RowArea" AreaIndex="1" 
                FieldName="Detail_List" Caption="รายการ">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField11" Area="DataArea" AreaIndex="0" 
                FieldName="Money Detail" Caption="จำนวนเงิน">
            </dx:PivotGridField>
            <dx:PivotGridField ID="PivotGridField12" Area="ColumnArea" AreaIndex="0" 
                FieldName="Status">
            </dx:PivotGridField>
        </Fields>
<StylesPrint Cell-BackColor2="" Cell-GradientMode="Horizontal" FieldHeader-BackColor2="" FieldHeader-GradientMode="Horizontal" TotalCell-BackColor2="" TotalCell-GradientMode="Horizontal" GrandTotalCell-BackColor2="" GrandTotalCell-GradientMode="Horizontal" CustomTotalCell-BackColor2="" CustomTotalCell-GradientMode="Horizontal" FieldValue-BackColor2="" FieldValue-GradientMode="Horizontal" FieldValueTotal-BackColor2="" FieldValueTotal-GradientMode="Horizontal" FieldValueGrandTotal-BackColor2="" FieldValueGrandTotal-GradientMode="Horizontal" Lines-BackColor2="" Lines-GradientMode="Horizontal"></StylesPrint>
    </dx:ASPxPivotGrid>
    </asp:Panel>
            <asp:SqlDataSource ID="SqlDataSource_SelectAcount" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_accounting]"></asp:SqlDataSource>
            <dx:ASPxPivotGridExporter ID="ASPxPivotGridExporterDay" runat="server" 
        ASPxPivotGridID="PVG_ShowAcountDay" 
        OnCustomExportCell="ASPxPivotGridExporterDay_CustomExportCell">
                <OptionsPrint PrintDataHeaders="False" PrintFilterHeaders="True" 
            PrintHorzLines="True" PrintRowHeaders="True" PrintVertLines="True">
            <PageSettings Margins="80, 0, 100, 0" />
        </OptionsPrint>
    </dx:ASPxPivotGridExporter>
    <dx:ASPxPivotGridExporter ID="ASPxPivotGridExporterMonth" runat="server" 
        ASPxPivotGridID="PVG_Accountmonth" 
        OnCustomExportCell="ASPxPivotGridExporterDay_CustomExportCell">
        <OptionsPrint PrintDataHeaders="False" PrintFilterHeaders="True" 
            PrintHorzLines="True" PrintRowHeaders="True" PrintVertLines="True">
            <PageSettings Margins="80, 0, 100, 0" />
        </OptionsPrint>
    </dx:ASPxPivotGridExporter>
    <dx:ASPxPivotGridExporter ID="ASPxPivotGridExporterYear" runat="server" 
        ASPxPivotGridID="PVG_AcountYear" 
        OnCustomExportCell="ASPxPivotGridExporterDay_CustomExportCell">
        <OptionsPrint PrintDataHeaders="False" PrintFilterHeaders="True" 
            PrintHorzLines="True" PrintRowHeaders="True" PrintVertLines="True">
            <PageSettings Margins="80, 0, 100, 0" />
        </OptionsPrint>
    </dx:ASPxPivotGridExporter>
            </dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
    </asp:Content>
